import { qualityType, eventStatus, reporterType } from '@/config/dict'
import { parseTime } from '@/utils/index'

export const tableColumn = [
  {
    key: 'qualityType',
    label: '质量类型',
    minWidth: 180
  },
  {
    key: 'status',
    label: '当前状态',
    minWidth: 180,
    render: (_, rocord) => eventStatus.find(e => e.key === rocord.row.status).value
  },
  {
    key: 'eventResponsibleAccountName',
    label: '负责人',
    minWidth: 180
  },
  {
    key: 'componentName',
    label: '部件名称',
    minWidth: 180
  },
  {
    key: 'reporterType',
    label: '上报来源',
    minWidth: 180,
    render: (_, rocord) => reporterType.find(e => e.key === rocord.row.reporterType).value
  },
  {
    key: 'reporterName',
    label: '上报人',
    minWidth: 180
  },
  {
    key: 'reportTime',
    label: '上报时间',
    minWidth: 180,
    render: (_, rocord) => parseTime(rocord.row.createTime)
  }
]

export const tableSearch = [
  {
    label: '质量类型',
    type: 'select',
    key: 'qualityType',
    options: qualityType
  },
  {
    label: '开始时间',
    type: 'date',
    key: 'startReportTime'
  },
  {
    label: '结束时间',
    type: 'date',
    key: 'endReportTime'
  },
  {
    label: '状态',
    type: 'select',
    key: 'status',
    options: eventStatus
  },
  {
    label: '部门',
    type: 'select',
    key: 'reporterDeptId',
    options: []
  }
]
